<extend name="Base:main" />
<block name="script">
	<link rel="stylesheet" href="__PUBLIC__/seller/css/validform.css" />
	<script src="__PUBLIC__/seller/js/Validform_v5.3.2.js"></script>
</block>
<block name="content">
<div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
               分销清单
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">首页</a></li>
                <li><a href="#">商品管理</a></li>
                <li class="am-active">分销清单</li>
            </ol>
            <div class="tpl-portlet-components">
				<ul class="am-tabs-nav am-nav am-nav-tabs">
					<li <eq name="Think.get.status" value="1">class="am-active"</eq><empty name="Think.get.status" >class="am-active"</empty>><a href="{:U('Goods/supplyGoodsList')}">全部 ({$all_total})</a></li>
					<li <eq name="Think.get.status" value="2">class="am-active"</eq>><a href="{:U('Goods/supplyGoodsList',array('status' => 2))}">库存预警 ({$notice_total})</a></li>
					<li <eq name="Think.get.status" value="3">class="am-active"</eq>><a href="{:U('Goods/supplyGoodsList',array('status' => 3))}">在途商品 ({$transport_total})</a></li>
				</ul>
                <div class="tpl-block">
                    <div class="am-g">
                      
                          <form class="am-form" action="{:U('Goods/index')}" method="get">
                              <input type="hidden" name="c" value="{$Think.const.CONTROLLER_NAME}" class="form-control">
                                <input type="hidden" name="a" value="{$Think.const.ACTION_NAME}" class="form-control">
                                <input type="hidden" name="m" value="{$Think.const.MODULE_NAME}" class="form-control">
                               <div class="am-u-sm-12 am-u-md-5">
                                   
                                  <label class=" am-form-label">商品名称</label> <span style="display: inline-block;"><input type="text"  name="keyword" value="{$sh.keyword}"  class=" am-form-field"></span>
                               
                                </div>
                              
                             
                             
                                <div class="am-u-sm-12 am-u-md-3">
                                    <div class="am-input-group am-input-group-sm">
                                         <button type="submit" class="btn btn-purple btn-sm">
                                            <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                            Search
                                        </button>
                                    </div>
                                </div>
                          </form>
                    </div>
                    <div class="am-g">
                        <div class="am-u-sm-12">
                          
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                        <tr>
                                          
                                            <th class="table-check"> <input class="check-all" type="checkbox" value=""></th>
                                            <th width="60">清单ID</th>
                                            <th class="table-title"  width="200">商品名称</th>
                                            <th width="80">en13码</th>
                                            <th>市场价</th>
                                            <th>销售价</th>
                                            <th>供货价</th>
                                            <th>供货总量</th>
                                            <th>可用库存</th>
                                            <th>已销售</th>
                                            <th>分销商家</th>
                                            <th>锁定库存</th>
                                            <th>商品位置</th>
                                            <th>状态</th>
                                            <th class="table-set" width="120">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                      <volist name="lists" id="val">
                                        
                                        <tr>
                                            <td><input class="ids" type="checkbox" name="ids[]" value="{$val['id']}"></td>
                                            <td>{$val.id}</td>
                                            <td><a href="#">{$val.name}</a></td>
                                            <td>{$val['earn13']}</td>
                                            <td>{$val['market_price']}</td>
                                            <td>{$val['cost_price']}</td>
                                            <td>{$val['price']}</td>
                                            <td>{$val['stock_num_total']}</td>
                                            <td>{$val['stock_num']}</td>
                                            <td>{$val['sale_stock_num']}</td>
                                            <td>分销【{$val['total']}】家</td>
                                            <td>{$val['distribution_stock_num']}</td>
                                            <td><?php if($val['stock_status']==1):?>在仓库<?php else:?>运送途中
                                                <?php if($val['application_status'] == 1):?>
                                                            <a href="{:U('Goods/application' , array('id' => $val['id']))}"><span class="am-icon-pencil-square-o"></span> 审核不通过再次申请在库</a></dd></eq></td>
                                                     <?php elseif($val['application_status'] == 0):?>
                                                                已申请在库，等待管理员审核
                                                     <?php else:?>
                                                           <a href="{:U('Goods/application' , array('id' => $val['id']))}"><span class="am-icon-pencil-square-o"></span>申请在库</a></dd></eq></td>
                                                     <?php endif;?>
                                                   <?php endif;?>
                                            <dd>
                                                
                                            <td>
												<switch name="val.status">
													<case value="0">未审核</case>
													<case value="1"><span style="color:red">审核失败</span></case>
													<case value="2"><span style="color:green">通过审核</span></case>
												</switch>
											</td>
                                            <td>
												<div class="list_menu_info">
													操作
													<div class="list_menu_nav">
														<dl>
															<dd><a href="{:U('Goods/goodsSupplyCount' , array('id' => $val['id']))}" width="700" height="320" menu="load_iframe_url" title="供应产品数据统计">数据统计 <span class="am-icon-caret-down"></span></a></dd>
															<dd><a href="{:U('Goods/incStockNum' , array('id' => $val['id']))}" title="增加供货库存" ><span class="am-icon-pencil-square-o"></span> 库存更新</a></dd>
															<dd><a href="{:U('Goods/showStockLogList' , array('id' => $val['id']))}" title="增加供货库存" width="600" height="400" menu="load_iframe_url"><span class="am-icon-pencil-square-o"></span> 库存日志</a></dd>
															<?php if( $val['customer_id'] == $login_info['id'] ) : ?>
															<dd><a href="{:U('Goods/edit' , array('id' => $val['goods_id']))}"><span class="am-icon-pencil-square-o"></span> 修改商品</a></dd>
															<?php endif; ?>
															<?php if($val['status']==0 || $val['status']==1):?>
															<dd><a href="{:U('Goods/information' , array('id' => $val['id']))}"><span class="am-icon-pencil-square-o"></span> 修改资料</a></dd>
															<?php endif;?>
															<dd><a href="{:U('Goods/paymentTypeSave' , array('id' => $val['id']))}" title="付款支付方式修改" width="750" height="300" menu="load_iframe_url"><span class="am-icon-pencil-square-o"></span> 付款修改</a></dd>
														</dl>
													</div>
												</div>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                                <div class="am-cf">

                                    <div class="am-fr">
                                        <ul class="am-pagination tpl-pagination">
                                            {$page}
                                        </ul>
                                    </div>
                                </div>
                                <hr>

                        </div>

                    </div>
                </div>
                <div class="tpl-alert"></div>
            </div>

        </div>
    <script>
            $(function () {
                var goods_type_id = $('#goods_type').val();
                if(goods_type_id){
                    $('#goods_type_id option').each(function(){
                          if( goods_type_id == $(this).attr('value') ) {
                              $(this).attr('selected' , true);
                              return false;
                          } 
                       }); 
                }
            })
          $(".check-all").click(function () {
            $(".ids").prop("checked", this.checked);
        });
          $(".ids").click(function () {
            var option = $(".ids");
            option.each(function (i) {
                if (!this.checked) {
                    $(".check-all").prop("checked", false);
                    return false;
                } else {
                    $(".check-all").prop("checked", true);
                }
            });
        });
       
    </script>
    
</block>